package com.hj.enroll.service;

import com.hj.enroll.mapper.AdminMapper;
import com.hj.enroll.pojo.Admin;
import com.hj.enroll.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService{


    @Autowired
    private  AdminMapper adminMapper;
    @Override
    public List<Admin> findAllAdmin() {


        List<Admin> admins = adminMapper.findAllAdmin();

        return admins;
    }

    @Override
    public Admin updateAdmin(Admin admins) {
        Admin admin = adminMapper.updateAdmin(admins);
        return admin;
    }

    @Override
    public Admin loginAdmin(String name, String password) {
        Admin admin = adminMapper.searchAdmin(name, password);
        return admin;
    }

}
